package so.sao.code.service.infrastructure.jpa.convert;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

import so.sao.code.dto.enums.ThirdPartyCodeFileStatus;

@Converter(autoApply = true)
public class ThirdPartyCodeFileStatusConvert implements AttributeConverter<ThirdPartyCodeFileStatus, Integer> {

	@Override
	public Integer convertToDatabaseColumn(ThirdPartyCodeFileStatus attribute) {
		return attribute.getValue();
	}

	@Override
	public ThirdPartyCodeFileStatus convertToEntityAttribute(Integer dbData) {
		return ThirdPartyCodeFileStatus.get(dbData);
	}

}
